<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Detail: redis/service_redis_client.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Detail
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_cebb7d08ed93c19198378459bbcfe4fa.html">redis</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">service_redis_client.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="service__redis__client_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// #ifndef SERVICE_REDIS_CLIENT_HPP</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">// #define SERVICE_REDIS_CLIENT_HPP</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;box/service_context.hh&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;hiredis/include/hiredis.h&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;redis/redis.hh&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="service__tool_8hpp.html">service_tool.hpp</a>&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="singleton_8hpp.html">singleton.hpp</a>&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">namespace </span>guild_service {</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">namespace </span>common {</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classguild__service_1_1common_1_1service__redis__client.html">   41</a></span>&#160;<span class="keyword">class </span><a class="code" href="classguild__service_1_1common_1_1service__redis__client.html">service_redis_client</a> : <span class="keyword">public</span> <a class="code" href="classguild__service_1_1common_1_1service__tool.html">service_tool</a> {</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;  <span class="keyword">using</span> service_context_type = kratos::service::ServiceContext;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;  <span class="keyword">using</span> redis_ptr_type = kratos::service::RedisPtr;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;  <span class="keyword">using</span> redis_handler_type = kratos::redis::RedisHandler;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;  <span class="keyword">using</span> redis_result_type = kratos::redis::Result;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  <span class="keyword">using</span> redis_reply_type = redisReply;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  <a class="code" href="classguild__service_1_1common_1_1service__redis__client.html">service_redis_client</a>() : <a class="code" href="classguild__service_1_1common_1_1service__tool.html">service_tool</a>(), m_redis_ptr(<span class="keyword">nullptr</span>) {}</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  <a class="code" href="classguild__service_1_1common_1_1service__redis__client.html">service_redis_client</a>(service_context_type *context)</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;      : <a class="code" href="classguild__service_1_1common_1_1service__tool.html">service_tool</a>(), m_redis_ptr(std::move(context-&gt;new_redis())) {}</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  <span class="keyword">virtual</span> ~<a class="code" href="classguild__service_1_1common_1_1service__redis__client.html">service_redis_client</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  <span class="keyword">const</span> redis_ptr_type &amp;operator-&gt;()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_redis_ptr; }</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classguild__service_1_1common_1_1service__redis__client.html#a38a189add0de8db7b5397b1e02f5148a">   64</a></span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classguild__service_1_1common_1_1service__redis__client.html#a38a189add0de8db7b5397b1e02f5148a">start</a>()<span class="keyword"> override </span>{</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="classguild__service_1_1common_1_1service__tool.html#a2031e4504dfb311eec63267d6a835318">service_tool::start</a>()) {</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;      <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    }</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keywordflow">return</span> m_redis_ptr-&gt;start();</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  }</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="classguild__service_1_1common_1_1service__redis__client.html#a9eb76fedbc43d575e35d2bd3b7b21cec">   78</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classguild__service_1_1common_1_1service__redis__client.html#a9eb76fedbc43d575e35d2bd3b7b21cec">stop</a>() {</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="classguild__service_1_1common_1_1service__tool.html#a8e1bb0c64cf1d7b93ac0152dea7fd4b6">service_tool::stop</a>()) {</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;      <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    }</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="classguild__service_1_1common_1_1service__tool.html#a2428d690f9812ad121edd5d02650a6da">get_user_count</a>() == 0) {</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;      <span class="keywordflow">if</span> (!m_redis_ptr-&gt;stop()) {</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;      }</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    }</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  }</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classguild__service_1_1common_1_1service__redis__client.html#a1f8299bef09b793943c2599a14d1cb6f">   98</a></span>&#160;  std::size_t <a class="code" href="classguild__service_1_1common_1_1service__redis__client.html#a1f8299bef09b793943c2599a14d1cb6f">update</a>(std::time_t ms) { <span class="keywordflow">return</span> m_redis_ptr-&gt;update(ms); }</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  redis_ptr_type m_redis_ptr;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;};</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;}  <span class="comment">// namespace common</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160; </div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="preprocessor">#define RedisClientSingleton(...)                              \</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="preprocessor">  (*common::singleton&lt;common::service_redis_client&gt;::instance( \</span></div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="preprocessor">      __VA_ARGS__))  </span></div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="preprocessor"></span> </div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="service__redis__client_8hpp.html#a0752d2320b846227ac97ce216d831e27">  111</a></span>&#160;<span class="keyword">using</span> redis_handler_type =</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    common::service_redis_client::redis_handler_type;  </div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="service__redis__client_8hpp.html#a879938d13a74dc6d2b0b8b0b4a20b03e">  113</a></span>&#160;<span class="keyword">using</span> <a class="code" href="service__redis__client_8hpp.html#a40db0e49ed8f7eb3dac18a32b45131db">redis_result_type</a> =</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    common::service_redis_client::redis_result_type;  </div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="service__redis__client_8hpp.html#a40db0e49ed8f7eb3dac18a32b45131db">  115</a></span>&#160;<span class="keyword">using</span> <a class="code" href="service__redis__client_8hpp.html#a0db98d4ff8b7a3af8ae8d0e39f7d5448">redis_reply_type</a> =</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    common::service_redis_client::redis_reply_type;  </div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="service__redis__client_8hpp.html#a0db98d4ff8b7a3af8ae8d0e39f7d5448">  117</a></span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;constexpr uint32_t <a class="code" href="service__redis__client_8hpp.html#a1d1da97ea7897858a311261ebd3f59c6">kRedisCommonTimeOut</a> =</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    1000;  </div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="service__redis__client_8hpp.html#a1d1da97ea7897858a311261ebd3f59c6">  120</a></span>&#160;constexpr uint32_t <a class="code" href="service__redis__client_8hpp.html#affbe1598865cab29d8e9427afcd10f44">kRedisCommonTimeOutAsync</a> =</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    1000;  </div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="service__redis__client_8hpp.html#affbe1598865cab29d8e9427afcd10f44">  122</a></span>&#160;constexpr <span class="keywordtype">char</span> <a class="code" href="service__redis__client_8hpp.html#a88a88173d5ff99c3f1a9144b9f16603b">kRedisHost</a>[] = <span class="stringliteral">&quot;127.0.0.1&quot;</span>;  </div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;constexpr uint32_t <a class="code" href="service__redis__client_8hpp.html#a002e13f5d43fb9c06cc3d171f33a5e6b">kRedisPort</a> = 6379;       </div>
<div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="service__redis__client_8hpp.html#a88a88173d5ff99c3f1a9144b9f16603b">  124</a></span>&#160;constexpr <span class="keywordtype">char</span> <a class="code" href="service__redis__client_8hpp.html#aecb027365d990187d9c127f492f2634a">kRedisUser</a>[] = <span class="stringliteral">&quot;&quot;</span>;           </div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="service__redis__client_8hpp.html#a002e13f5d43fb9c06cc3d171f33a5e6b">  125</a></span>&#160;constexpr <span class="keywordtype">char</span> <a class="code" href="service__redis__client_8hpp.html#a3cd93c93d0185a9a19f6867eb324effd">kRedisPasswd</a>[] = <span class="stringliteral">&quot;&quot;</span>;         </div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="service__redis__client_8hpp.html#aecb027365d990187d9c127f492f2634a">  126</a></span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="service__redis__client_8hpp.html#a3cd93c93d0185a9a19f6867eb324effd">  127</a></span>&#160;constexpr <span class="keywordtype">char</span> kRedisGetOp[] = <span class="stringliteral">&quot;GET &quot;</span>;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;constexpr <span class="keywordtype">char</span> kRedisSetOp[] = <span class="stringliteral">&quot;SET &quot;</span>;</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;constexpr <span class="keywordtype">char</span> kRedisDelOp[] = <span class="stringliteral">&quot;DEL &quot;</span>;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;constexpr <span class="keywordtype">char</span> kRedisHGetOp[] = <span class="stringliteral">&quot;HGET &quot;</span>;</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;constexpr <span class="keywordtype">char</span> kRedisHSetOp[] = <span class="stringliteral">&quot;HSET &quot;</span>;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;constexpr <span class="keywordtype">char</span> kRedisHDelOp[] = <span class="stringliteral">&quot;HDEL &quot;</span>;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="comment">// constexpr char kRedisGet</span></div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160; </div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> redis_command_async(<span class="keyword">const</span> std::string &amp;name,</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;                                       <span class="keyword">const</span> std::string &amp;command,</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;                                       std::time_t timeout,</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;                                       <a class="code" href="service__redis__client_8hpp.html#a879938d13a74dc6d2b0b8b0b4a20b03e">redis_handler_type</a> handler,</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;                                       std::uint64_t user_data) {</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="service__redis__client_8hpp.html#a0752d2320b846227ac97ce216d831e27">RedisClientSingleton</a>()-&gt;do_command(name, command, timeout, handler,</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;                                            user_data);</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;}</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160; </div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="keyword">inline</span> <span class="keyword">static</span> std::unique_ptr&lt;redis_result_type&gt; redis_command_co(</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="keyword">const</span> std::string &amp;name, <span class="keyword">const</span> std::string &amp;command, std::time_t timeout) {</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="service__redis__client_8hpp.html#a0752d2320b846227ac97ce216d831e27">RedisClientSingleton</a>()-&gt;do_command_co(name, command, timeout);</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;}</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;<span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> redis_add_host(<span class="keyword">const</span> std::string &amp;name,</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;                                  <span class="keyword">const</span> std::string &amp;host, <span class="keywordtype">int</span> port,</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;                                  <span class="keyword">const</span> std::string &amp;user,</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;                                  <span class="keyword">const</span> std::string &amp;passwd) {</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="service__redis__client_8hpp.html#a0752d2320b846227ac97ce216d831e27">RedisClientSingleton</a>()-&gt;add_host(name, host, port, user, passwd);</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;}</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160; </div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;<span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> redis_reply_is_nil(<span class="keyword">const</span> redis_result_type &amp;result) {</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;  <span class="keyword">auto</span> *reply = <span class="keyword">reinterpret_cast&lt;</span><a class="code" href="service__redis__client_8hpp.html#a0db98d4ff8b7a3af8ae8d0e39f7d5448">redis_reply_type</a> *<span class="keyword">&gt;</span>(result.get_reply());</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;  <span class="keywordflow">return</span> reply &amp;&amp; reply-&gt;type == REDIS_REPLY_NIL;</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;}</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160; </div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;}  <span class="comment">// namespace guild_service</span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;<span class="comment">// #endif // REDIS_CLIENT_HPP</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aservice__redis__client_8hpp_html_a879938d13a74dc6d2b0b8b0b4a20b03e"><div class="ttname"><a href="service__redis__client_8hpp.html#a879938d13a74dc6d2b0b8b0b4a20b03e">guild_service::redis_handler_type</a></div><div class="ttdeci">common::service_redis_client::redis_handler_type redis_handler_type</div><div class="ttdoc">redis回调函数类型</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:114</div></div>
<div class="ttc" id="aservice__redis__client_8hpp_html_a3cd93c93d0185a9a19f6867eb324effd"><div class="ttname"><a href="service__redis__client_8hpp.html#a3cd93c93d0185a9a19f6867eb324effd">guild_service::kRedisPasswd</a></div><div class="ttdeci">constexpr char kRedisPasswd[]</div><div class="ttdoc">redis连接密码</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:127</div></div>
<div class="ttc" id="aclassguild__service_1_1common_1_1service__tool_html"><div class="ttname"><a href="classguild__service_1_1common_1_1service__tool.html">guild_service::common::service_tool</a></div><div class="ttdoc">服务使用计数类</div><div class="ttdef"><b>Definition:</b> service_tool.hpp:34</div></div>
<div class="ttc" id="aservice__redis__client_8hpp_html_a88a88173d5ff99c3f1a9144b9f16603b"><div class="ttname"><a href="service__redis__client_8hpp.html#a88a88173d5ff99c3f1a9144b9f16603b">guild_service::kRedisHost</a></div><div class="ttdeci">constexpr char kRedisHost[]</div><div class="ttdoc">redis连接IP</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:124</div></div>
<div class="ttc" id="aclassguild__service_1_1common_1_1service__redis__client_html_a9eb76fedbc43d575e35d2bd3b7b21cec"><div class="ttname"><a href="classguild__service_1_1common_1_1service__redis__client.html#a9eb76fedbc43d575e35d2bd3b7b21cec">guild_service::common::service_redis_client::stop</a></div><div class="ttdeci">bool stop()</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:78</div></div>
<div class="ttc" id="aservice__redis__client_8hpp_html_affbe1598865cab29d8e9427afcd10f44"><div class="ttname"><a href="service__redis__client_8hpp.html#affbe1598865cab29d8e9427afcd10f44">guild_service::kRedisCommonTimeOutAsync</a></div><div class="ttdeci">constexpr uint32_t kRedisCommonTimeOutAsync</div><div class="ttdoc">redis通用异步超时时间（单位 毫秒）</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:122</div></div>
<div class="ttc" id="aclassguild__service_1_1common_1_1service__tool_html_a8e1bb0c64cf1d7b93ac0152dea7fd4b6"><div class="ttname"><a href="classguild__service_1_1common_1_1service__tool.html#a8e1bb0c64cf1d7b93ac0152dea7fd4b6">guild_service::common::service_tool::stop</a></div><div class="ttdeci">virtual bool stop()</div><div class="ttdef"><b>Definition:</b> service_tool.hpp:57</div></div>
<div class="ttc" id="aservice__redis__client_8hpp_html_a002e13f5d43fb9c06cc3d171f33a5e6b"><div class="ttname"><a href="service__redis__client_8hpp.html#a002e13f5d43fb9c06cc3d171f33a5e6b">guild_service::kRedisPort</a></div><div class="ttdeci">constexpr uint32_t kRedisPort</div><div class="ttdoc">redis连接端口</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:125</div></div>
<div class="ttc" id="aclassguild__service_1_1common_1_1service__redis__client_html_a38a189add0de8db7b5397b1e02f5148a"><div class="ttname"><a href="classguild__service_1_1common_1_1service__redis__client.html#a38a189add0de8db7b5397b1e02f5148a">guild_service::common::service_redis_client::start</a></div><div class="ttdeci">virtual bool start() override</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:64</div></div>
<div class="ttc" id="aservice__redis__client_8hpp_html_aecb027365d990187d9c127f492f2634a"><div class="ttname"><a href="service__redis__client_8hpp.html#aecb027365d990187d9c127f492f2634a">guild_service::kRedisUser</a></div><div class="ttdeci">constexpr char kRedisUser[]</div><div class="ttdoc">redis连接用户名</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:126</div></div>
<div class="ttc" id="aclassguild__service_1_1common_1_1service__tool_html_a2031e4504dfb311eec63267d6a835318"><div class="ttname"><a href="classguild__service_1_1common_1_1service__tool.html#a2031e4504dfb311eec63267d6a835318">guild_service::common::service_tool::start</a></div><div class="ttdeci">virtual bool start()</div><div class="ttdef"><b>Definition:</b> service_tool.hpp:46</div></div>
<div class="ttc" id="aclassguild__service_1_1common_1_1service__tool_html_a2428d690f9812ad121edd5d02650a6da"><div class="ttname"><a href="classguild__service_1_1common_1_1service__tool.html#a2428d690f9812ad121edd5d02650a6da">guild_service::common::service_tool::get_user_count</a></div><div class="ttdeci">int get_user_count() const</div><div class="ttdoc">Get the user count object.</div><div class="ttdef"><b>Definition:</b> service_tool.hpp:75</div></div>
<div class="ttc" id="aservice__redis__client_8hpp_html_a40db0e49ed8f7eb3dac18a32b45131db"><div class="ttname"><a href="service__redis__client_8hpp.html#a40db0e49ed8f7eb3dac18a32b45131db">guild_service::redis_result_type</a></div><div class="ttdeci">common::service_redis_client::redis_result_type redis_result_type</div><div class="ttdoc">redis返回结果类型</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:116</div></div>
<div class="ttc" id="aclassguild__service_1_1common_1_1service__redis__client_html"><div class="ttname"><a href="classguild__service_1_1common_1_1service__redis__client.html">guild_service::common::service_redis_client</a></div><div class="ttdoc">服务redis客户端类</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:41</div></div>
<div class="ttc" id="aservice__redis__client_8hpp_html_a1d1da97ea7897858a311261ebd3f59c6"><div class="ttname"><a href="service__redis__client_8hpp.html#a1d1da97ea7897858a311261ebd3f59c6">guild_service::kRedisCommonTimeOut</a></div><div class="ttdeci">constexpr uint32_t kRedisCommonTimeOut</div><div class="ttdoc">redis通用同步超时时间（单位 毫秒）</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:120</div></div>
<div class="ttc" id="asingleton_8hpp_html"><div class="ttname"><a href="singleton_8hpp.html">singleton.hpp</a></div><div class="ttdoc">单例模板</div></div>
<div class="ttc" id="aclassguild__service_1_1common_1_1service__redis__client_html_a1f8299bef09b793943c2599a14d1cb6f"><div class="ttname"><a href="classguild__service_1_1common_1_1service__redis__client.html#a1f8299bef09b793943c2599a14d1cb6f">guild_service::common::service_redis_client::update</a></div><div class="ttdeci">std::size_t update(std::time_t ms)</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:98</div></div>
<div class="ttc" id="aservice__tool_8hpp_html"><div class="ttname"><a href="service__tool_8hpp.html">service_tool.hpp</a></div><div class="ttdoc">服务使用计数</div></div>
<div class="ttc" id="aservice__redis__client_8hpp_html_a0752d2320b846227ac97ce216d831e27"><div class="ttname"><a href="service__redis__client_8hpp.html#a0752d2320b846227ac97ce216d831e27">RedisClientSingleton</a></div><div class="ttdeci">#define RedisClientSingleton(...)</div><div class="ttdoc">redis客户端单例</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:107</div></div>
<div class="ttc" id="aservice__redis__client_8hpp_html_a0db98d4ff8b7a3af8ae8d0e39f7d5448"><div class="ttname"><a href="service__redis__client_8hpp.html#a0db98d4ff8b7a3af8ae8d0e39f7d5448">guild_service::redis_reply_type</a></div><div class="ttdeci">common::service_redis_client::redis_reply_type redis_reply_type</div><div class="ttdoc">redis返回原始类型</div><div class="ttdef"><b>Definition:</b> service_redis_client.hpp:118</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
